package com.jintian.smart.kernel.flowable.flowable.agenda;

import org.flowable.common.engine.impl.interceptor.CommandContext;
import org.flowable.engine.FlowableEngineAgenda;
import org.flowable.engine.impl.agenda.DefaultFlowableEngineAgenda;
import org.flowable.engine.impl.agenda.DefaultFlowableEngineAgendaFactory;
import org.flowable.engine.impl.persistence.entity.ExecutionEntity;

public class CustomFlowableEngineAgenda extends DefaultFlowableEngineAgendaFactory {

    @Override
    public FlowableEngineAgenda createAgenda(CommandContext commandContext) {
        return new DefaultFlowableEngineAgenda(commandContext) {
            @Override
            public void planTakeOutgoingSequenceFlowsOperation(ExecutionEntity execution, boolean evaluateConditions) {
                planOperation(new CustomTakeOutgoingSequenceFlowsOperation(commandContext, execution, evaluateConditions), execution);
            }
        };
    }
}
